package WaiBao;

import java.util.Arrays;

public class WuKeKe {
    public static void main(String[] args) {
        String[] name = {"王小胖(班长)", "王境泽(团支书)", "小李(学习委员)", "郭立伟(体育委员)", "贺世鹏", "李贺", "李白", "汤神", "帐篷", "小猴", "老鼠", "猫腻",
                "郭红艳", "张鹏伟", "高标", "高血压", "倪道红", "谢霆锋", "权志龙", "梁朝伟", "古天乐", "郭富城", "张家辉", "吴郑宇", "周传雄", "华成宇", "周深", "队长",
                "肖战", "吴轲轲 (学生)"};//最后一位考生本人: 吴轲轲 (学生)
        int[] Age = {20, 19, 18, 21, 20, 21, 21, 21, 19, 19, 18, 18, 18, 20, 20, 19, 18, 18, 18, 18, 19, 19, 20, 20, 20, 18, 19, 19, 18, 21};//考生年龄：21岁

        double[] green1 = {94, 86, 91, 84, 71, 69, 74, 89, 89, 90, 90, 87, 85, 79, 65, 68, 69, 99, 96, 88, 92, 91, 95, 88, 75, 74, 78, 74, 80, 95};
        double[] green2 = {91, 94, 74, 66, 81, 97, 81, 76, 91, 75, 90, 77, 86, 75, 65, 65, 86, 79, 66, 68, 92, 71, 95, 85, 75, 84, 79, 64, 90, 95};
        double[] green3 = {77, 94, 90, 83, 71, 67, 75, 79, 85, 60, 94, 87, 85, 75, 65, 68, 69, 69, 96, 93, 92, 81, 95, 95, 79, 84, 77, 71, 89, 95};

        double pullpue;//代表每个学生的总分
        double black;//代表每个学生的平均分
//        for (int i = 0; i < 30; i++) {
//            pullpue = green1[i] +green2[i] +green3[i];
//            black = ( pullpue * 1.0) / 3;
//            System.out.println(name[i] + "的总分为:" +  pullpue);
//            System.out.println(name[i] + "的平均分为:" + black);
//        }


        double pink = 0, blac = 0;
        double[] cam = new double[30];
//        for (int i = 0; i < 30; i++) {
//            pink   = green1[i] +  green2[i] + green3[i];
//            blac= (pink  * 1.0) / 3;
//            cam[i] = blac;
//        }
//
//        for (int i = 0; i < cam.length - 1; i++) {
//            for (int j = 0; j < cam.length - i - 1; j++) {
//                if (cam[j] < cam[j + 1]) {
//                    double tep = cam[j];
//                    cam[j] =cam[j + 1];
//                    cam[j + 1] = tep;
//                }
//            }
//        }
//        System.out.println("前十名同学的成绩为:");
//        for (int i = 0; i < 10; i++) {
//            System.out.println(cam[i]);
//        }


        double cctv1 = 0,cctv2 = 0,cctv3 = 0;//计算每门课的平均分
        double qq1 = 0,qq2 = 0, qq3 = 0;//计算每门课标准差
        double wechat1 = 0,  wechat2 = 0,  wechat3 = 0;//计算每门课中位数
        double sum2 = 0;
        for (int i = 0; i < green1.length; i++) {
            sum2+=green1[i];
        }
        cctv1 = (sum2*1.0)/30;
        System.out.println("生物化学的班级平均分为:"+cctv1);
        double Sum = 0;
        for (int i = 0; i < green2.length; i++) {
            Sum+=green2[i];
        }
        cctv2 = (Sum*1.0)/30;
        System.out.println("微生物学的班级平均分为:"+cctv2);
        double sum = 0;
        for (int i = 0; i <green3.length; i++) {
            sum+=green3[i];
        }
        cctv3 = (sum*1.0)/30;
        System.out.println("人体组织解剖学的班级平均分为:"+cctv3);


//
        double c1 = 0,c2 = 0,c3 = 0;
        for (int i = 0; i < green1.length; i++) {
            c1+= ( green1[i] -cctv1)*(green1[i] - cctv1);
        }
        qq1 = Math.sqrt(c1*1.0/30);
        System.out.println("生物化学的班级标准差为:"+qq1);

        for (int i = 0; i < green2.length; i++) {
            c2+= (green2[i] - cctv2)*(green2[i] - cctv2);
        }
        qq2 = Math.sqrt(c2*1.0/30);
        System.out.println("微生物学的班级标准差为:"+qq2);

        for (int i = 0; i < green3.length; i++) {
            c3+= (green3[i] -cctv3)*(green3[i] - cctv3);
        }
        qq3 = Math.sqrt(c3*1.0/30);
        System.out.println("人体组织解剖学的班级标准差为:"+qq3);
//////
////////
//        Arrays.sort(green1);
//        Arrays.sort(green2);
//        Arrays.sort(green3);
//        wechat1 =( green1[14]+green1[15])*1.0/2;
//        wechat2 =( green2[14]+green2[15])*1.0/2;
//        wechat3 =(green3[14]+green3[15])*1.0/2;
//        System.out.println("生物化学的中位数为:"+ wechat1);
//        System.out.println("微生物学的中位数为:"+ wechat2);
//        System.out.println("人体组织解剖学的中位数为:"+ wechat3);



    }
}
